﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace t4tesk1
{
    public partial class gameins : Form
    {
        public gameins()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string OutputContent="";
            OutputContent += "新游戏"+"\n";
            OutputContent += "游戏名称："+textBox1.Text+"\n";
            OutputContent += "游戏类别："+comboBox1.Text+"\n";
            //+-----------------------------------判断游戏状态--------------------------------------------------
            if(radioButton1.Checked)
                OutputContent += "游戏状态：" + radioButton1.Text + "\n";
            if (radioButton2.Checked)
                OutputContent += "游戏状态：" + radioButton1.Text + "\n";
            if (radioButton3.Checked)
                OutputContent += "游戏状态：" + radioButton1.Text + "\n";
            //+-----------------------------------判断游戏类型--------------------------------------------------
            OutputContent += "游戏类型：";
            if (checkBox1.Checked)
                OutputContent+= checkBox1.Text + ",";
            if (checkBox2.Checked)
                OutputContent += checkBox2.Text + ",";
            if (checkBox2.Checked)
                OutputContent += checkBox2.Text + ",";
            if (checkBox2.Checked)
                OutputContent += checkBox2.Text + ",";
            if (checkBox1.Checked)
                OutputContent +=  checkBox2.Text ;
            //+------------------------------------添加游戏类型--------------------------------------------------
            string sql = string.Format("insert into GameType(GameTypeName) values ('{0}')", comboBox1.Text);
            bool reader = DBHelper.GetNonQuery(sql);
            MessageBox.Show(OutputContent);
            this.Hide();
        }
    }
}
